package lib

func init() {
	Probs = append(Probs, Problem{
		Num:         119,
		Discription: "生成杨辉三角的第n行",
		Level:       1,
		Labels: map[string]int{
			"动态规划": 1,
			"空间复用": 1,
		},
	})
}

func GetRow(rowIndex int) []int {
	col := make([]int, rowIndex+1)
	col[0] = 1
	//每一行从右往左
	for i := 1; i <= rowIndex; i++ {
		for j := i; j >= 1; j-- {
			col[j] += col[j-1]
		}
	}

	return col
}
